/*
 * Licensed by the Bunie Developmentgroup
 */
package Protocol;

/**
 * QueryRequestPacket for the managementqueries
 * @author Patrick Wobben
 * @version v0.95
 * @since v0.95 (20-5-2012)
 */

public class QueryRequestPacket extends BasicPacket {
    
    private String query;
    private int queryId;
    private String queryName;
	private String seed;
    private int status;
    public final static int SELECT = 0;
    public final static int UPDATE = 1;
    public final static int DELETE = 2;
    public final static int INSERT = 3;
	public final static int RESEED = 4;
	public final static int COLUMN = 5;
   
    /**
     * Constructor for the inlogrequestpacket
     *
     * @param version Version of this inlogresponsepacket
     */
    public QueryRequestPacket(int version) {
        super(version);
        this.type = PacketTypeKeeper.QUERYREQUESTPACKET;
    }
    
    /**
     * Methode to set the query that needs to be executed
     * @param query 
     */
    public void setQuery(String query){
        this.query = query;
    }
    
    /**
     * Methode to get the query that needs to be executed
     * @return 
     */
    public String getQuery(){
        return query;
    }
    
    /**
     * Methode to set the id of the query
     * @param id 
     */
    public void setQueryId(int id){
        this.queryId = id;
    }
    
    /**
     * Methode to get the id of the query
     * @return 
     */
    public int getQueryId(){
        return queryId;
    }
    
    /**
     * Methode to set the name of the query
     * @param queryName 
     */
    public void setQueryName(String queryName){
        this.queryName = queryName;
    }
    
    /**
     * Methode to get the name of the query
     * @return 
     */
    public String getQueryName(){
        return queryName;
    }
    
    /**
     * Methode to set the status of the query
     * @param status 
     */
    public void setStatus(int status){
        this.status = status;
    }
    
    /**
     * Methode to get the status of the query
     * @return 
     */
    public int getStatus(){
        return status;
    }
	
	/**
	 * Sets the seed
	 * @param seed Random string seed
	 */
	public void setSeed(String seed) {
		this.seed = seed;
	}
	
	public String getSeed() {
		return seed;
	}
	
    @Override
    public int getType() {
        return this.type;
    }
       
    @Override
    public String toString() {
        return super.toString()+
               "query: "+query  +" "+
               "queryID: "+queryId + "  "+
               "queryName: "+queryName+" "+
               "query type "+getStatus();
    }
}
